<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>角色列表</title>
		<#include "../include/base.ftl">
		<style type="text/css">
			#edit-role-permission-box{padding:10px;}
			#edit-role-permission-box .permission{width:160px;display:inline-block;}
			#edit-role-permission-box .panel.panel-htop{margin-top:10px;}
		</style>
	</head>
	<body>
		<table id="role-list-box" class="easyui-datagrid" style="width:100%;height:650px;" toolbar="#role-list-btn"
				title="角色列表" iconCls="icon-save" url="role/list_data" singleSelect=true
				rownumbers="true" pagination="true" pageSize=10  pageList=[10,20,30,40,50]  pageNumber=1>
			<thead>
				<tr>
					<th field="id" width="80" hidden=true>ID</th>
					<th field="roleName" width="150" align="center">角色名称</th>
					<th field="roleCode" width="200" align="center">角色代码</th>
					<th field="description" width="400" align="center">角色描述</th>
			    	<th field="createdTime" width="200" align="center">创建时间</th>
					<th field="editTime" width="200" align="center">修改时间</th>
				</tr>
			</thead>
		</table>
		
		<div id="role-list-btn" class="search-box">
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:showAddBox();">新增</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="javascript:showEditBox();">修改</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:deleteRole();">刪除</a>
			&nbsp;&nbsp;
			<span class="search-label">角色名称:</span>
			<input id="roleName" class="easyui-textbox search-input">
			<span class="search-label">角色代码:</span>
			<input id="roleCode" class="easyui-textbox search-input">
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch()">查询</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-reload" plain="true" onclick="resetSearchBox()">重置</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-filter" plain="true" onclick="javascript:editMenu();">配置菜单</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-lock" plain="true" onclick="javascript:editPermission();">配置权限</a>
		</div>
		
		<div id="edit-role-box" class="easyui-window add-box" title="修改角色信息" style="width:500px;height:270px;display:none;left:200px;top:80px;background:#fafafa;"
		        closed="true" modal="true" collapsible="false" minimizable="false" maximizable="false" draggable="false" resizable="false">  
		    <form action="role/save_role" method="post" id="edit-role-form" autocomplete="off">
		    	<table class="form-table">
		    		<tr>
		    			<th align="right">角色名称：</th>
		    			<td>
		    				<input type="text" name="roleName" id="editRoleName" class="easyui-textbox add-input" data-options="required:true"/>
		    				<input type="hidden" name="id" id="editId"/>
		    			</td>
		    		</tr>
		    		<tr>
		    			<th align="right">角色代码：</th>
		    			<td><input type="text" name="roleCode" id="editRoleCode" class="easyui-textbox add-input" data-options="required:true"/></td>
		    		</tr>
		    		<tr>
		    			<th align="right">角色描述：</th>
		    			<td>
		    				<input type="text" name="description" id="editDescription" style="width:300px;" class="easyui-textbox add-input" data-options="multiline:true,resize:false">
		    			</td>
		    		</tr>
		    	</table>
		    	<br/>
		    	<div class="form-buttons">
		    		<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-save" onclick="javascript:submitSaveRole();">提交</a>
		    		&nbsp;&nbsp;&nbsp;
					<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#edit-role-box').dialog('close');">关闭</a>
		    	</div>
		    </form>  
		</div> 
		
		<div id="edit-role-menu-box" class="easyui-window" title="配置角色菜单" style="width:400px;height:550px;display:none;left:500px;top:80px;background:#fafafa;"
		        closed="true" modal="true" collapsible="false" minimizable="false" maximizable="false" draggable="false" resizable="false">  
			<ul id="menu-tree" class="easyui-tree" checkbox=true lines=true>
			</ul>
			<div style="margin-top:30px;text-align:center;"><a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-ok" onclick="setRoleMenu();">确定</a></div>
		</div> 
		   
		
		<div id="edit-role-permission-box" class="easyui-window" title="配置角色权限" style="width:650px;height:500px;display:none;left:100px;top:80px;background:#fafafa;"
		        closed="true" modal="true" collapsible="false" minimizable="false" maximizable="false" draggable="false" resizable="false">  
			<div id="permission-list-box"></div>
			<div style="margin-top:30px;text-align:center;">
				<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-reload" onclick="selectAll();">全选</a>
				<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-undo" onclick="cancleAll();">取消</a>
				<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-ok" onclick="setRolePermission();">确定</a>
			</div>
		</div>
		<script type="text/javascript" src="${request.contextPath}/style/web/js/portal-role.js"></script>
	</body>
</html>